var express = require("express");
var router = express.Router();

const trafficsModel = require("../models/traffics_module");

// 通勤找房详情页面数据
router.post("/list", function (req, res, next) {
  const { company, type } = req.body;

  trafficsModel.find(
    {
      $and: [{ company: company }, { traffic: { type: type } }],
    },
    (err, doc) => {
      if (err) throw err;
      res.json({
        status: 0,
        data: doc.traffic,
      });
    }
  );
});

module.exports = router;
